package org.example;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.RestOptions;
import org.apache.flink.table.api.EnvironmentSettings;
import org.apache.flink.table.api.TableEnvironment;

public class FlinkBatchInsetUpdateDelete2 {
    public static void main(String[] args) throws Exception {
        EnvironmentSettings settings = EnvironmentSettings.newInstance().inBatchMode().build();
        TableEnvironment tableEnv = TableEnvironment.create(settings);

        // 创建Paimon catalog
        tableEnv.executeSql("CREATE CATALOG paimon WITH (\n" +
                "    'type' = 'paimon',\n" +
                "    'warehouse' = 'file:///tmp/paimon'\n" +
                ");");

        tableEnv.executeSql("-- 更新一条数据\n" +
                "UPDATE `paimon`.`default`.`user_behavior_with_pk` SET item_id = '00001更新测试' WHERE dt='2025-01-13';\n");

    }
}